define([
    'jquery',
    'underscore',
    'backbone',
    //'text!templates/form/form_add_admin.html'
    ], function($, _, Backbone,loginTemplate){
        var $html_loadding = '<div class="caculation-report"><img style="margin-left:170px" src="'+$template_admincp_url+'img/standard/loaders/loading64.gif"/></div>';
        var translateView = Backbone.View.extend({
            el: $("#main"),
            initialize: function(){
				
            },
            events: {
                
            },
            
            view: function(){
                var url = location.href;
                if(typeof oTable != "undefined"){
                    $("#table_translate").dataTable().fnDestroy();
                }
                $file = $base_url+'assets/language/datatables/us.txt';

                var aoColumns = [];
                aoColumns.push({
                    "sType": "string",
                    "swidth": "25%",
                    "sClass": "string",
                    "sName": "keyword"
                });
                $.each( $data_lang, function( key, value ) {
                    aoColumns.push({
                        "sType": "string",
                        "swidth": "25%",
                        "sClass": "string",
                        "sName": "translate_"+value.lang_code
                    });
                });
                aoColumns.push({
                    "sType": "string",
                    "swidth": "3%",
                    "sClass": "center",
                    "bSortable": false
                });
                
                oTable = $("#table_translate").dataTable({
                    "sDom": "<'row'<'col-lg-8'l><'col-lg-1 button_create'><'col-lg-3'f>r>t<'row'<'col-lg-6'i><'col-lg-6'p>>",
                    "sPaginationType": "full_numbers",
                    "iDisplayLength": 10,
                    "iDisplayStart": 0,
                    "bProcessing": true,
                    "bRetrieve": true,
                    "bServerSide": true,
                    "sAjaxSource": url,
                    "fnServerData": function(sSource, aaData, fnCallback, oSetting){
                        if(typeof filters != "undefined"){
                            obj_tmp = new Object;
                            $.each(filters, function(name, value){
                                obj_tmp[name] = value;
                            });
                            aoData.push({
                                name: "myFilter",
                                value: JSON.stringify(obj_tmp)
                            });
                        }
                        $.ajax({
                            dataType: "JSON",
                            url: sSource,
                            type: "POST",
                            data: aaData,
                            success: function(rs){
                                data = rs;
                                fnCallback(rs);
                            }
                        });
                    },
                    "aoColumns": aoColumns,
                    fnInitComplete: function()
                    {   
                    }
                });
            },

            add: function(){
            },

            edit: function(){
            },

            render: function(){
                if(typeof this[$app.action] != 'undefined'){
                    new this[$app.action];
                }
            }
        });
        return translateView = new translateView;
    });
